/*
-----------------------------------------------------------------------------
This source file is part of DIVA
The project of Engineering Lab, dept. of CSIE, NTNU.

Copyright (c) 2000-2006 The Software Engineering Lab, dept. of CSIE, NTNU.
-----------------------------------------------------------------------------
Filename:    ubvm_pie.h
Description: This file is a vm that show values in shape of cone.
-----------------------------------------------------------------------------
*/
/*------------------------------------------------------------*/
#ifndef _ubvm_pie_H_
#define	_ubvm_pie_H_
/*------------------------------------------------------------*/

#include "DIVA_VM.h"
#include "MovableText.h"
#include <string>
#include "xParameterPack.h"

//using namespace Ogre;

class ubvm_pie: public DIVA_VM{
protected:
	int* _vm_radius ;
	int* _vm_height ;

	float* _vm_start_theta ;
	float* _vm_end_theta ;
	int* _vm_start_degree ;
	int* _vm_end_degree ;

	float _start_theta ;
	float _end_theta ;

	Ogre::ManualObject* _manual ;
	Ogre::MeshPtr _meshptr ;
	static int _UNIQUE_INT ;
	string _mesh_name ;
	string _manual_name ;
public:
	/// constructor & destructor
	ubvm_pie(xParameterPack xpp);
	~ubvm_pie();

	/// draw - for animation or not.
	//void draw();
	std::string getVMType() { return std::string("primitive"); }

	// the overriden method of DIVA_VM
	void load_3Dresources();
	void reg_event_entity();
	void set_default_values();

	void init_private_attrs_started(); // no more private attributes
	void init_private_attrs_ended(); // special process for attr vm_radius
	void VMValueUpdated();

    // the overridden method of OgreVM
	void setBodyScale(Ogre::Vector3);
	Ogre::Vector3 getOriginalBodySize();
	Ogre::Vector3 getActualSize();
	bool isBodyScaleWrtSceneNode();
	Ogre::Vector3 getBodyScale();

	// 暫時的function - 將integer轉成string
	std::string intToString(int its){
	std::stringstream ss;
	std::string str;

	ss << its;
	str = ss.str();
	ss.str("");

	return str;
	}

};
/*------------------------------------------------------------*/
#endif	//#ifndef _ubvm_pie_H_
/*------------------------------------------------------------*/